import { generateBaseApi, prefix } from './base'
import request from '../utils/request'

/**
 * User rest api
 */
const basePath = '/system/users'
const baseApi = generateBaseApi(basePath)
export default {
  ...baseApi,
  userInfo: (userName) => {
    return request(`${prefix}${basePath}/info?userName=${userName}`, {
      method: 'GET',
    })
  },

  roles: (id) => {
    return request(`${prefix}${basePath}/${id}/roles`, {
      method: 'GET',
    })
  },

  resources: (id) => {
    return request(`${prefix}${basePath}/${id}/resources`, {
      method: 'GET',
    })
  },
}
